Repository navigation
Conversation
Use :focus-visible for admin menu focus indicators so touch taps do not leave a stale active appearance on previously selected items. Clear the responsive selected state when another top-level menu is opened or when navigating via a submenu link. Limit admin menu view transitions to the current menu item to avoid overlapping active styles during navigation. Fixes #65280.
When the responsive menu is opened, focus was moved to the first menu item (Dashboard). On browsers that match :focus-visible for scripted focus (e.g. Safari/WebKit on iOS), that first item receives the active highlight, so two menu items appear active at once. Move focus to the current top-level item when one exists, falling back to the first menu link, so the focused item is the one that is meant to be highlighted. Follow-up to the :focus-visible changes for #65280.
The admin color schemes (compiled from colors/_admin.scss) styled the top-level menu highlight on plain :focus, overriding the :focus-visible rules in admin-menu.css since color scheme CSS loads later. This brought back the active appearance for pointer/scripted focus on browsers that match :focus-visible inconsistently. Switch the color scheme highlight to :focus-visible to match admin-menu.css, and drop the now-redundant :not(:focus-visible) overrides that were compensating for the mismatch. Follow-up to the :focus-visible changes for #65280.
… menu link. Moving focus to the current menu item when the responsive menu is opened is a behavior change beyond the scope of this ticket, and is better considered as a separate enhancement. See #65280.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
This would prevent the class from having every pair groups, so it doesn't seem beneficial.
|
@itzmekhokan I removed the subclass change in view transitions; I don't think that matches the intent of the class, and I can't honestly see any real difference in outcome. If you have a good reason for this, let me know how to reproduce it. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
@joedolson Thanks, agreed. One leftover: the assertion I added at line 45 of |
clones and updates 11902
Trac ticket: https://core.trac.wordpress.org/ticket/65280
Use of AI Tools
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.